from selenium import webdriver

# driver = webdriver.Chrome()
driver = webdriver.PhantomJS(executable_path="/media/zhkai/Data/phantomjs-2.1.1-linux-x86_64/bin/phantomjs")
# 浏览器请求指定网址
driver.get("http://www.dfenqi.cn")
# 向浏览器指定控件中输入值
driver.find_element_by_id("username").send_keys("139xxxx5176")
driver.find_element_by_id("password").send_keys("xxxxxx")
# 单击登录按钮
driver.find_element_by_class_name("dl").click()